<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<!DOCTYPE html>
<html lang="en">
<head>

<title><spring:message code="label.title"/></title>

<script src="<c:url value="resources/bootstrap/js/sha1.js"/>"></script>

<script src="<c:url value="resources/bootstrap/js/jquery.min.js"/>"></script>
	
<script type="text/javascript">
function formhash(form, password) {
	password.value = CryptoJS.SHA1(password.value);
}
$(function(){
	$('#capcha').click(function () { $(this).attr('src', 'captcha.jpg?' + Math.floor(Math.random()*100) ); })
}); 
</script>	

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="<c:url value="resources/bootstrap/css/bootstrap.min.css"/>">
<link rel="stylesheet" href="resources/Login.css">

<style>
html, body {
 background-image: url("resources/img/android-l-wallpaper-flat.jpg");
 	background-size: 100%;
 	background-repeat: no-repeat;
}

</style>

</head>

<body>
<div id="changeLanguage">
	        <a id="lcEn"><img src="resources/img/uk1.png"></a>
            <a id="lcVi"><img src="resources/img/vn3.png"></a>  
</div>
	<div class="container">
		<div class="content">       
          
         
		
			<form class="form-signin" role="form" action="CaptchaCheck" method="POST" id="formlogin">
				
				<c:if test="${not empty error}">
			<div class="alert alert-warning">${error}</div>
		</c:if>
		<c:if test="${not empty msg}">
			<div class="alert alert-warning">${msg}</div>
		</c:if>
		<c:if test="${not empty lockalert}">
			<div class="alert alert-warning">${lockalert}</div>
		</c:if>
		
		<c:if test="${not empty captcha }">
			<div class="alert alert-warning">${captcha}</div>
		</c:if>
					<h1 align="center"><span class="label label-default"><spring:message code="label.formtitle"/></span></h1>
					<br>
					<input type="text" class="form-control" placeholder="<spring:message code="label.idHolder"/>" name="username" required autofocus>
					<input type="password" class="form-control" placeholder="<spring:message code="label.passwordHolder"/>" name="password" id="password" required>
						<br>
					<img id="capcha"  src="captcha.jpg"><br>
					<small><spring:message code="label.captchaText"/></small>
					<input type="text" name="kaptchafield" class="form-control" placeholder="<spring:message code="label.captchaHolder"/>">
					
					<br>
					<button class="btn btn-lg btn-primary btn-block" type="submit" value="submit" id="submit" onclick="formhash(this,this.form.password);"><spring:message code="label.formtitle"/></button>
					<%-- <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /> --%>
			</form>
		</div>
	</div>
	<!-- /container -->
	
	<br>
	
<img id="kite"  src="resources/img/kite1.png">
<img id="cloud" src="resources/img/cloud.png">

</body>
 <script>
 $( "#lcVi" ).click(function() {
	 window.location =document.URL.split('?')[0]+"?locale=vi";
	 document.body.className = 'vi'; 
	 });
 $( "#lcEn" ).click(function() {
	 window.location =document.URL.split('?')[0]+"?locale=en";
	 document.body.className = 'en';
	 });
 </script>
</html>

